package com.model.dto.sys.userController;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
public class UpdateEmailDTO {
    @ApiModelProperty(value = "临时密钥",required = true)
    String passwordKey;

    /** 邮箱 */
    @ApiModelProperty(value = "邮箱长度限制为50")
    @Size(min = 0, max = 50, message = "邮箱长度限制为50")
    @Pattern(regexp = "\\b[\\w.%+-]+@[\\w.-]+\\.[a-zA-Z]{2,6}\\b", message = "邮箱格式不合法")
    String newEmail;

    /** 邮箱验证码 */
    @ApiModelProperty(value = "邮箱验证码，验证码长度限制为4位")
    @NotNull(message = "验证码不能为空")
    @Size(min = 4, max = 4, message = "验证码长度限制为4位")
    String emailCode;
}
